/*
 Copyright 2014 GVLabs.org

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

package org.gvlabs.math.utils;

import java.math.BigDecimal;

/**
 * Class that represent an interval (set of real numbers)
 * 
 * @author Thiago Galbiatti Vespa
 * @version 1.0
 */
public class Interval {
	private BigDecimal a;
	private BigDecimal b;

	/**
	 * BigDecimal Constructor
	 * 
	 * @param a
	 *            first endpoint
	 * @param b
	 *            second endpoint
	 */
	public Interval(BigDecimal a, BigDecimal b) {
		super();
		this.a = a;
		this.b = b;
	}

	/**
	 * Double Constructor
	 * 
	 * @param a
	 *            first endpoint
	 * @param b
	 *            second endpoint
	 */
	public Interval(Double a, Double b) {
		super();
		this.a = new BigDecimal(a);
		this.b = new BigDecimal(b);
	}

	/**
	 * Gets the value of first endpoint
	 * 
	 * @return first endpoint
	 */
	public BigDecimal getA() {
		return a;
	}

	/**
	 * Gets the value of second endpoint
	 * 
	 * @return second endpoint
	 */
	public BigDecimal getB() {
		return b;
	}

}
